

#include <mutex>
#include <iostream>

class noncopyable
{
public:
    noncopyable(const noncopyable&) = delete;
    void operator=(const noncopyable&) = delete;

protected:
    noncopyable() = default;
    ~noncopyable() = default;
};


class A : noncopyable
{
public:
    A()
    {
        std::cout << "construct" << std::endl;
    }

    ~A()
    {
        std::cout << "destruct" << std::endl;
    }

    /* 如果生效以下代码， 则noncopyable无效*/
    A(const A& other)
    {
        std::cout << "copy" << std::endl;
    }
    void operator = (const A& other)
    {
        std::cout << "=" << std::endl;
    }
};

int main()
{
    A a;
    A b(a);
    A c;
    c = a;
}